package practice;

import java.util.Scanner;

public class _11Time {
    public static void main(String[] args) {
        int h,m,s;
        long millisecond,millisecond_;
        Scanner scanner = new Scanner(System.in);
        millisecond = scanner.nextLong();
        //  毫秒转换成秒
        millisecond_=millisecond/1000;
        //  一年中的秒数：31536000
        //  实际上可以不用对一年中所有的秒数取模
        if(millisecond_>31536000) {
            //  如果秒数大于一年的秒数
            //  一天中的秒数：24*3600 = 86400
            s = (int) millisecond_%(31536000)%60;
            m = (int) millisecond_%(31536000)/60%60;
            h = (int) millisecond_%(31536000)/3600%24;
            System.out.printf("%02d:%02d:%02d",h,m,s);
        }else {
            //  重点！！！
            s = (int) millisecond_%60;
            m = (int) millisecond_/60%60;
            h = (int) millisecond_/3600%24;
            System.out.printf("%02d:%02d:%02d",h,m,s);
        }
    }
}
